from utils.network import Interface


class API(Interface):
    def handle(self, req):
        if 'username' in req and req['username'] is not None:
            self.user.username = req['username']
        if 'password' in req and req['password'] is not None:
            self.user.password = req['password']
        return self.success_respond({
            'account': self.user.account,
            'username': self.user.username
        })
